package logger

import "sync"

var (
	gl     AppLogger
	lMutex sync.RWMutex
)

func SetGlobalLogger(l AppLogger) AppLogger {
	lMutex.Lock()
	defer lMutex.Unlock()
	gl = l
	return gl
}

func L() AppLogger {
	lMutex.RLock()
	g := gl
	lMutex.RUnlock()
	return g
}
